# Maintainer: JackNapier <jacknapier151@gmail.com>
# Contributor: 

pkgbase="godot-base"
pkgname=(
	"${pkgbase}-icons"
	"${pkgbase}-license"
	"${pkgbase}-man"
	"${pkgbase}-desktop"
	"${pkgbase}-fish-completions"
	"${pkgbase}-bash-completions"
	"${pkgbase}-zsh-completions"
)
pkgver="0.0"
pkgrel=0
pkgdesc="Godot Game Engine: An advanced, feature packed, multi-platform 2D and 3D game engine. Base Documents"
url="http://www.godotengine.org"
license=("MIT")
groups=(
	"godot-full"
	"godot-base"
)
arch=("any")
source=(
	"godot_icon.png::https://github.com/godotengine/godot/raw/master/icon.png"
	"godot_icon.svg::https://github.com/godotengine/godot/raw/master/icon.svg"
	"godot_icon_outlined.png::https://github.com/godotengine/godot/raw/master/icon_outlined.png"
	"godot_icon_outlined.svg::https://github.com/godotengine/godot/raw/master/icon_outlined.svg"
	"godot_logo.png::https://github.com/godotengine/godot/raw/master/logo.png"
	"godot_logo.svg::https://github.com/godotengine/godot/raw/master/logo.svg"
	"godot_logo_outlined.png::https://github.com/godotengine/godot/raw/master/logo_outlined.png"
	"godot_logo_outlined.svg::https://github.com/godotengine/godot/raw/master/logo_outlined.svg"

	"godot_icon_console.svg::https://github.com/godotengine/godot/raw/master/misc/dist/icon_console.svg"
	"godot_project_icon.svg::https://github.com/godotengine/godot/raw/master/misc/dist/project_icon.svg"
	"godot_gdscript.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/gdscript.svg"
	"godot_gdscript_extra_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/gdscript_extra_small.svg"
	"godot_gdscript_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/gdscript_small.svg"
	"godot_project.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/project.svg"
	"godot_project_extra_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/project_extra_small.svg"
	"godot_project_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/project_small.svg"
	"godot_resource.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/resource.svg"
	"godot_resource_extra_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/resource_extra_small.svg"
	"godot_resource_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/resource_small.svg"
	"godot_scene.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/scene.svg"
	"godot_scene_extra_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/scene_extra_small.svg"
	"godot_scene_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/scene_small.svg"
	"godot_shader.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/shader.svg"
	"godot_shader_extra_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/shader_extra_small.svg"
	"godot_shader_small.svg::https://github.com/godotengine/godot/raw/master/misc/dist/document_icons/shader_small.svg"

	"LICENSE.txt::https://github.com/godotengine/godot/raw/master/LICENSE.txt"
	"LOGO_LICENSE.txt::https://github.com/godotengine/godot/raw/master/LOGO_LICENSE.txt"
	"COPYRIGHT.txt::https://github.com/godotengine/godot/raw/master/COPYRIGHT.txt"
	"AUTHORS.md::https://github.com/godotengine/godot/raw/master/AUTHORS.md"
	"DONORS.md::https://github.com/godotengine/godot/raw/master/DONORS.md"

	"godot-base.6::https://github.com/godotengine/godot/raw/master/misc/dist/linux/godot.6"
	"org.godotengine.godot-base.desktop::https://github.com/godotengine/godot/raw/master/misc/dist/linux/org.godotengine.Godot.desktop"
	"org.godotengine.godot-base.xml::https://github.com/godotengine/godot/raw/master/misc/dist/linux/org.godotengine.Godot.xml"
	"org.godotengine.godot-base.appdata.xml::https://github.com/godotengine/godot/raw/master/misc/dist/linux/org.godotengine.Godot.appdata.xml"
	"godot-base.fish::https://github.com/godotengine/godot/raw/master/misc/dist/shell/godot.fish"
	"godot-base.bash-completion::https://github.com/godotengine/godot/raw/master/misc/dist/shell/godot.bash-completion"
	"_godot-base.zsh-completion::https://github.com/godotengine/godot/raw/master/misc/dist/shell/_godot.zsh-completion"
)
sha512sums=(
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"

	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"

	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"

	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
	"SKIP"
)


package_godot-base-icons() {
	groups+=(
		"godot-icons"
	)
	install -Dm644 "${srcdir}"/godot_icon.png "${pkgdir}"/usr/share/pixmaps/godot_icon.png
	install -Dm644 "${srcdir}"/godot_icon.svg "${pkgdir}"/usr/share/pixmaps/godot_icon.svg
	ln -s "/usr/share/pixmaps/godot_icon.png" "${pkgdir}/usr/share/pixmaps/godot.png"
	install -Dm644 "${srcdir}"/godot_icon_outlined.png "${pkgdir}"/usr/share/pixmaps/godot_icon_outlined.png
	install -Dm644 "${srcdir}"/godot_icon_outlined.svg "${pkgdir}"/usr/share/pixmaps/godot_icon_outlined.svg
	install -Dm644 "${srcdir}"/godot_logo.png "${pkgdir}"/usr/share/pixmaps/godot_logo.png
	install -Dm644 "${srcdir}"/godot_logo.svg "${pkgdir}"/usr/share/pixmaps/godot_logo.svg
	install -Dm644 "${srcdir}"/godot_logo_outlined.png "${pkgdir}"/usr/share/pixmaps/godot_logo_outlined.png
	install -Dm644 "${srcdir}"/godot_logo_outlined.svg "${pkgdir}"/usr/share/pixmaps/godot_logo_outlined.svg

	install -Dm644 "${srcdir}"/godot_icon_console.svg "${pkgdir}"/usr/share/pixmaps/godot_icon_console.svg
	install -Dm644 "${srcdir}"/godot_project_icon.svg "${pkgdir}"/usr/share/pixmaps/godot_project_icon.svg
	install -Dm644 "${srcdir}"/godot_gdscript.svg "${pkgdir}"/usr/share/pixmaps/godot_gdscript.svg
	install -Dm644 "${srcdir}"/godot_gdscript_extra_small.svg "${pkgdir}"/usr/share/pixmaps/godot_gdscript_extra_small.svg
	install -Dm644 "${srcdir}"/godot_gdscript_small.svg "${pkgdir}"/usr/share/pixmaps/godot_gdscript_small.svg
	install -Dm644 "${srcdir}"/godot_project.svg "${pkgdir}"/usr/share/pixmaps/godot_project.svg
	install -Dm644 "${srcdir}"/godot_project_extra_small.svg "${pkgdir}"/usr/share/pixmaps/godot_project_extra_small.svg
	install -Dm644 "${srcdir}"/godot_project_small.svg "${pkgdir}"/usr/share/pixmaps/godot_project_small.svg
	install -Dm644 "${srcdir}"/godot_resource.svg "${pkgdir}"/usr/share/pixmaps/godot_resource.svg
	install -Dm644 "${srcdir}"/godot_resource_extra_small.svg "${pkgdir}"/usr/share/pixmaps/godot_resource_extra_small.svg
	install -Dm644 "${srcdir}"/godot_resource_small.svg "${pkgdir}"/usr/share/pixmaps/godot_resource_small.svg
	install -Dm644 "${srcdir}"/godot_scene.svg "${pkgdir}"/usr/share/pixmaps/godot_scene.svg
	install -Dm644 "${srcdir}"/godot_scene_extra_small.svg "${pkgdir}"/usr/share/pixmaps/godot_scene_extra_small.svg
	install -Dm644 "${srcdir}"/godot_scene_small.svg "${pkgdir}"/usr/share/pixmaps/godot_scene_small.svg
	install -Dm644 "${srcdir}"/godot_shader.svg "${pkgdir}"/usr/share/pixmaps/godot_shader.svg
	install -Dm644 "${srcdir}"/godot_shader_extra_small.svg "${pkgdir}"/usr/share/pixmaps/godot_shader_extra_small.svg
	install -Dm644 "${srcdir}"/godot_shader_small.svg "${pkgdir}"/usr/share/pixmaps/godot_shader_small.svg
}

package_godot-base-license() {
	groups+=(
		"godot-license"
	)
	install -Dm644 "${srcdir}"/LICENSE.txt "${pkgdir}"/usr/share/licenses/godot-base/LICENSE
	install -Dm644 "${srcdir}"/LOGO_LICENSE.txt "${pkgdir}"/usr/share/licenses/godot-base/LOGO_LICENSE.txt
	install -Dm644 "${srcdir}"/COPYRIGHT.txt "${pkgdir}"/usr/share/licenses/godot-base/COPYRIGHT
	install -Dm644 "${srcdir}"/AUTHORS.md "${pkgdir}"/usr/share/licenses/godot-base/AUTHORS.md
	install -Dm644 "${srcdir}"/DONORS.md "${pkgdir}"/usr/share/licenses/godot-base/DONORS.md
}

package_godot-base-man() {
	groups+=(
		"godot-man"
	)
	install -Dm644 "${srcdir}"/godot-base.6 "${pkgdir}/usr/share/man/man6/godot-base.6"
	ln -s "/usr/share/man/man6/godot-base.6" "${pkgdir}/usr/share/man/man6/godot.6"
}

package_godot-base-desktop() {
	groups+=(
		"godot-desktop"
	)
	install -Dm644 "${srcdir}"/org.godotengine.godot-base.xml "${pkgdir}/usr/share/mime/packages/org.godotengine.godot-base.xml"
	ln -s "/usr/share/mime/packages/org.godotengine.godot-base.xml" "${pkgdir}/usr/share/mime/packages/org.godotengine.godot.xml"
	install -Dm644 "${srcdir}"/org.godotengine.godot-base.appdata.xml "${pkgdir}/usr/share/mime/packages/org.godotengine.godot-base.appdata.xml"
	ln -s "/usr/share/mime/packages/org.godotengine.godot-base.appdata.xml" "${pkgdir}/usr/share/mime/packages/org.godotengine.godot.appdata.xml"
	install -Dm644 "${srcdir}"/org.godotengine.godot-base.desktop "${pkgdir}/usr/share/applications/org.godotengine.godot-base.desktop"
	ln -s "/usr/share/applications/org.godotengine.godot-base.desktop" "${pkgdir}/usr/share/applications/org.godotengine.godot.desktop"
}

package_godot-base-fish-completions() {
	groups+=(
		"godot-fish"
		"godot-completions"
	)
	install -Dm644 "${srcdir}"/godot-base.fish "${pkgdir}/usr/share/fish/completions/godot-base"
	ln -s "/usr/share/fish/completions/godot-base" "${pkgdir}/usr/share/fish/completions/godot"
}

package_godot-base-bash-completions() {
	groups+=(
		"godot-bash"
		"godot-completions"
	)
	install -Dm644 "${srcdir}"/godot-base.bash-completion "${pkgdir}/usr/share/bash-completion/completions/godot-base"
	ln -s "/usr/share/bash-completion/completions/godot-base" "${pkgdir}/usr/share/bash-completion/completions/godot"
}

package_godot-base-zsh-completions() {
	groups+=(
		"godot-zsh"
		"godot-completions"
	)
	install -Dm644 "${srcdir}"/_godot-base.zsh-completion "${pkgdir}/usr/share/zsh/site-functions/_godot-base"
	ln -s "/usr/share/zsh/site-functions/_godot-base" "${pkgdir}/usr/share/zsh/site-functions/_godot"
}
